package com.port.eleport.model.plat;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.port.eleport.model.base.IdEntity;

/**
 * 进货
 * 
 * @author jameschen
 * 
 */
@Entity
@Table(name = "plat_stock", schema = "")
@DynamicInsert(true)
@DynamicUpdate(true)
public class TStock extends IdEntity {

	/**
	 * 进货时间
	 */
	@Column(name = "stock_date")
	private Date stockDate;

	/**
	 * 数量
	 */
	@Column(name = "qty_")
	private Integer qty;

	/**
	 * 计量单位
	 */
	@Column(name = "unit_")
	private String unit;
	/**
	 * 进货单价
	 */
	@Column(name = "price_")
	private BigDecimal price;
	/**
	 * 进货总价
	 */
	@Column(name = "amount_")
	private BigDecimal amount;
	/**
	 * 进货方式(1:采购2:调拨)
	 */
	@Column(name = "type_")
	private String type;
	/**
	 * 商品
	 */
	@ManyToOne
	@JoinColumn(name = "product_id")
	private TProduct product;

	/**
	 * 仓库
	 */
	@ManyToOne
	@JoinColumn(name = "entrepot_id")
	private TEntrepot entrepot;

	public Date getStockDate() {
		return stockDate;
	}

	public void setStockDate(Date stockDate) {
		this.stockDate = stockDate;
	}

	public Integer getQty() {
		return qty;
	}

	public void setQty(Integer qty) {
		this.qty = qty;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public BigDecimal getAmount() {
		return amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public TProduct getProduct() {
		return product;
	}

	public void setProduct(TProduct product) {
		this.product = product;
	}

	public TEntrepot getEntrepot() {
		return entrepot;
	}

	public void setEntrepot(TEntrepot entrepot) {
		this.entrepot = entrepot;
	}
}
